package com.yunduansing.demo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author yunduansing
 * @since 2020-05-24
 */
@Data
@TableName("sys_user")
@Table(name = "sys_user")
@Entity
@ApiModel(value="UserEntity对象", description="")
public class UserEntity implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Id
    private Integer id;

    private String account;

    private String password;

    private String fullName;

    private Integer status;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;

    private Boolean isAdmin;

    @ApiModelProperty(value = "0-女、1-男")
    private Boolean sex;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate birth;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate joinDate;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate leaveDate;

    private String image;

    @ApiModelProperty(value = "现住址")
    private String familyAddress;

    @ApiModelProperty(value = "家庭住址")
    private String originAddress;

    private String mobile;

    @ApiModelProperty(value = "紧急联系人")
    private String emergencyContact;

    @ApiModelProperty(value = "紧急联系人关系")
    private String emergencyRelation;

    @ApiModelProperty(value = "紧急联系人电话")
    private String emergencyMobile;

    @ApiModelProperty(value = "true-离职、false-未离职")
    private Boolean leaved;
    @ApiModelProperty(value = "政治面貌字典编码")
    private String political;
    @ApiModelProperty(value = "工号，系统生成，不可修改")
    private String number;
    private String enterpriseEmail;
    private String email;
    @ApiModelProperty(value = "学历，对应字典类型为：xl")
    private String education;
    @ApiModelProperty(value = "户口类型，对应字典类型为：hklx")
    private String householdType;
    @ApiModelProperty(value = "婚姻状态，对应字典类型：hyzt")
    private String maritalStatus;
    @ApiModelProperty(value = "民族，对应字典类型：mz")
    private String ethnicity;

    public UserEntity(){}

    public UserEntity(String account,String password,String fullName,Integer status,boolean isAdmin){
        this.account=account;
        this.password=password;
        this.status=status;
        this.fullName=fullName;
        this.isAdmin=isAdmin;
    }

    public UserEntity(Integer id,String account,String password,String fullName,Integer status,boolean isAdmin){
        this.account=account;
        this.password=password;
        this.status=status;
        this.fullName=fullName;
        this.isAdmin=isAdmin;
        this.id=id;
    }
}
